chromeframe = {};

chromeframe.init = function ()
{
	var avail = CFInstall.isAvailable ();
	if ( avail ) return true;

	var message = 'Non stai usando Chrome Frame! <a href="javascript:chromeframe.install()">Clicca qui</a> per usarlo.';

	liwe.utils.notifier.show ( message, liwe.utils.notifier.mode.MESSAGE, 5000 );
};

chromeframe.close = function ()
{
	$( 'os3-chrome-frame-overlay' ).hide ();
};

chromeframe.install = function ()
{
	liwe.utils.notifier.hide ();
	var iframe = '<iframe src="http://www.google.com/chromeframe/eula.html?prefersystemlevel=true" width="100%" height="100%">';

	var overlay = document.createElement ( 'div' );
	overlay.id = 'os3-chrome-frame-overlay';

	var content = document.createElement ( 'div' );
	content.id = 'os3-chrome-frame';
	content.innerHTML = iframe;
	
	var button = document.createElement ( 'div' );
	button.id = 'os3-chrome-frame-button';
	button.onclick = chromeframe.close;

	overlay.appendChild ( button );
	overlay.appendChild ( content );

	document.body.appendChild ( overlay );
};
